﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;


namespace Loyalty.UI.Infrastructure.CustomFilter
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
    public class FormNameAttribute : ActionFilterAttribute
    {
        //private DbServiceLayer DbServiceLayer = null;
        //private IUnitOfWork _unitOfWork;
        
        //public override void OnActionExecuting(ActionExecutingContext filterContext)
        //{
        //    _unitOfWork = StructureMap.ObjectFactory.GetInstance<IUnitOfWork>();
        //    DbServiceLayer = new DbServiceLayer(_unitOfWork);
        //    string controllerType = filterContext.ActionDescriptor.ControllerDescriptor.ControllerType.FullName;
        //    DbServiceLayer.DD_Form_Add(new DD_Form()
        //        {
        //            FormName = controllerType,
        //            FormCaption = "ثبت اتوماتیک",
        //            FormGUID = controllerType.GetGUID().ToString()
        //        });
        //    base.OnActionExecuting(filterContext);
        //}
    }
}